import request from "@/utils/request";

// !试题列表
export const getQuestionApi = (params) =>
  request({
    url: "/exam/question",
    params,
  });
// !获取单个试题
export const getOneApi = (id) =>
  request({
    url: "/exam/question/" + id,
  });

// !学科信息
export const getSubjectApi = () =>
  request({
    url: "/subject/tree",
  });
// !题目上下架
export const getShowQuestionApi = (data) =>
  request({
    url: "/exam/question/show",
    method: "post",
    data,
  });
// !新增试题信息 接口
export const addQuestion = (data) =>
  request({
    url: "/exam/question",
    method: "POST",
    data,
  });
// !修改试题信息 接口
export const editQuestion = (data) =>
  request({
    url: "/exam/question/" + data.id,
    method: "PUT",
    data,
  });
// !审核
export const checkQuestion = (data) =>
  request({
    url: "/exam/question/check",
    method: "POST",
    data,
  });

// !试题删除
export const deleteQuestion = (id) =>
  request({
    url: `/exam/question/${id}`,
    method: "DELETE",
  });
